import request from './request'

export function $http(options) {
  return request(options).then(d => d.result)
}

export function getSourceJson() {
  return request.get('/api/sourceJson').then(d => d.result)
}

export function getSelectData(keyWord) {
  return request.post('/api/selectData', { data: { keyWord } }).then(res => {
    console.log(res)
    return res.data
  }).catch(err => {
    console.error(err)
  })
}